/*
 Navicat Premium Data Transfer

 Source Server         : dbs
 Source Server Type    : MySQL
 Source Server Version : 80025
 Source Host           : localhost:3306
 Source Schema         : mydatabase

 Target Server Type    : MySQL
 Target Server Version : 80025
 File Encoding         : 65001

 Date: 08/05/2023 09:53:11
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for cities
-- ----------------------------
DROP TABLE IF EXISTS `cities`;
CREATE TABLE `cities` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `country` varchar(255) NOT NULL,
  `image` varchar(255) NOT NULL,
  `hot` tinyint(1) DEFAULT '0',
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;;

-- ----------------------------
-- Records of cities
-- ----------------------------
BEGIN;
INSERT INTO `cities` VALUES (1, '重庆', '中国', 'https://images.pexels.com/photos/16554127/pexels-photo-16554127.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', 1, '2023-04-11 06:09:21', '2023-04-11 06:09:21');
INSERT INTO `cities` VALUES (2, '西藏', '中国', 'https://images.pexels.com/photos/5204921/pexels-photo-5204921.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', 1, '2023-04-17 21:24:01', '2023-04-17 21:24:04');
INSERT INTO `cities` VALUES (3, '云南', '中国', 'https://images.pexels.com/photos/1531661/pexels-photo-1531661.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', 1, '2023-04-17 21:25:05', '2023-04-17 21:25:07');
INSERT INTO `cities` VALUES (4, '海南', '中国', 'https://images.pexels.com/photos/8138272/pexels-photo-8138272.jpeg?auto=compress&cs=tinysrgb&w=1600', 1, '2023-04-17 21:26:06', '2023-04-17 21:26:09');
INSERT INTO `cities` VALUES (5, '山西', '中国', 'https://images.pexels.com/photos/15138001/pexels-photo-15138001.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', 1, '2023-04-17 21:29:52', '2023-04-17 21:29:54');
INSERT INTO `cities` VALUES (6, '贵州', '中国', 'https://images.pexels.com/photos/11111333/pexels-photo-11111333.jpeg?auto=compress&cs=tinysrgb&w=600', 1, '2023-04-17 21:33:35', '2023-04-17 21:33:39');
COMMIT;

-- ----------------------------
-- Table structure for comments
-- ----------------------------
DROP TABLE IF EXISTS `comments`;
CREATE TABLE `comments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `text` text NOT NULL,
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL,
  `userId` int DEFAULT NULL,
  `spotId` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `userId` (`userId`) USING BTREE,
  KEY `spotId` (`spotId`) USING BTREE,
  CONSTRAINT `comments_ibfk_252` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `comments_ibfk_253` FOREIGN KEY (`spotId`) REFERENCES `spots` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;;

-- ----------------------------
-- Records of comments
-- ----------------------------
BEGIN;
INSERT INTO `comments` VALUES (1, 'hello world!', '2023-04-11 12:50:51', '2023-04-11 12:50:51', 1, NULL);
INSERT INTO `comments` VALUES (2, 'hello world!', '2023-04-11 15:01:53', '2023-04-11 15:01:53', 1, NULL);
INSERT INTO `comments` VALUES (3, 'hello world!', '2023-04-11 15:04:39', '2023-04-11 15:04:39', 1, NULL);
INSERT INTO `comments` VALUES (4, 'hello world!', '2023-04-12 00:00:36', '2023-04-12 00:00:36', 1, NULL);
INSERT INTO `comments` VALUES (5, '123', '2023-04-17 11:57:01', '2023-04-17 11:57:01', 1, NULL);
INSERT INTO `comments` VALUES (6, '123', '2023-04-17 11:58:09', '2023-04-17 11:58:09', 1, NULL);
INSERT INTO `comments` VALUES (7, '123', '2023-04-17 11:58:33', '2023-04-17 11:58:33', 1, NULL);
INSERT INTO `comments` VALUES (8, '123', '2023-04-17 11:59:05', '2023-04-17 11:59:05', 1, NULL);
INSERT INTO `comments` VALUES (9, '123', '2023-04-17 12:13:53', '2023-04-17 12:13:53', 1, NULL);
INSERT INTO `comments` VALUES (10, '123', '2023-04-17 12:13:56', '2023-04-17 12:13:56', 1, NULL);
INSERT INTO `comments` VALUES (11, '123', '2023-04-17 12:14:13', '2023-04-17 12:14:13', 1, NULL);
INSERT INTO `comments` VALUES (12, '123', '2023-04-17 12:14:31', '2023-04-17 12:14:31', 1, NULL);
INSERT INTO `comments` VALUES (13, '123', '2023-04-17 12:17:23', '2023-04-17 12:17:23', 1, NULL);
INSERT INTO `comments` VALUES (14, '123', '2023-04-17 12:18:02', '2023-04-17 12:18:02', 1, NULL);
INSERT INTO `comments` VALUES (15, '123', '2023-04-17 12:18:20', '2023-04-17 12:18:20', 1, NULL);
INSERT INTO `comments` VALUES (16, '123', '2023-04-17 12:18:33', '2023-04-17 12:18:33', 1, NULL);
INSERT INTO `comments` VALUES (17, '6666', '2023-04-17 12:49:41', '2023-04-17 12:49:41', 1, NULL);
INSERT INTO `comments` VALUES (18, '88888', '2023-04-17 12:50:28', '2023-04-17 12:50:28', 1, NULL);
INSERT INTO `comments` VALUES (19, '吃饭了\n', '2023-04-17 12:59:11', '2023-04-17 12:59:11', 1, NULL);
INSERT INTO `comments` VALUES (20, '哈哈说的话', '2023-04-17 13:00:11', '2023-04-17 13:00:11', 4, NULL);
INSERT INTO `comments` VALUES (21, '漂亮', '2023-04-17 13:39:13', '2023-04-17 13:39:13', 4, NULL);
INSERT INTO `comments` VALUES (22, 'niha', '2023-04-17 15:45:28', '2023-04-17 15:45:28', 4, NULL);
INSERT INTO `comments` VALUES (23, '123', '2023-04-17 16:13:16', '2023-04-17 16:13:16', 4, NULL);
INSERT INTO `comments` VALUES (24, 'ye', '2023-04-18 15:22:32', '2023-04-18 15:22:32', 11, NULL);
INSERT INTO `comments` VALUES (25, '你好啊', '2023-04-18 15:22:59', '2023-04-18 15:22:59', 12, NULL);
INSERT INTO `comments` VALUES (26, '埃菲尔铁塔在巴黎', '2023-04-18 15:24:57', '2023-04-18 15:24:57', 12, NULL);
INSERT INTO `comments` VALUES (27, '123\n', '2023-04-18 16:19:49', '2023-04-18 16:19:49', 4, NULL);
INSERT INTO `comments` VALUES (28, '123\n123\n', '2023-04-18 16:19:53', '2023-04-18 16:19:53', 4, NULL);
INSERT INTO `comments` VALUES (29, '夜景', '2023-04-19 14:50:04', '2023-04-19 14:50:04', 11, NULL);
INSERT INTO `comments` VALUES (30, '123213', '2023-05-08 01:11:31', '2023-05-08 01:11:31', 4, 37);
COMMIT;

-- ----------------------------
-- Table structure for Favorites
-- ----------------------------
DROP TABLE IF EXISTS `Favorites`;
CREATE TABLE `Favorites` (
  `id` int NOT NULL AUTO_INCREMENT,
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL,
  `spotId` int DEFAULT NULL,
  `userId` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `spotId` (`spotId`) USING BTREE,
  KEY `userId` (`userId`) USING BTREE,
  CONSTRAINT `Favorites_ibfk_7` FOREIGN KEY (`spotId`) REFERENCES `spots` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `Favorites_ibfk_8` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;;

-- ----------------------------
-- Records of Favorites
-- ----------------------------
BEGIN;
INSERT INTO `Favorites` VALUES (7, '2023-04-11 15:11:34', '2023-04-11 15:11:34', NULL, 1);
INSERT INTO `Favorites` VALUES (12, '2023-04-17 13:12:14', '2023-04-17 13:12:14', NULL, 4);
INSERT INTO `Favorites` VALUES (16, '2023-04-17 15:48:43', '2023-04-17 15:48:43', NULL, 4);
INSERT INTO `Favorites` VALUES (22, '2023-04-19 14:45:19', '2023-04-19 14:45:19', NULL, 11);
INSERT INTO `Favorites` VALUES (23, '2023-04-23 15:11:16', '2023-04-23 15:11:16', NULL, 14);
INSERT INTO `Favorites` VALUES (24, '2023-05-08 01:11:34', '2023-05-08 01:11:34', 37, 4);
COMMIT;

-- ----------------------------
-- Table structure for sights
-- ----------------------------
DROP TABLE IF EXISTS `sights`;
CREATE TABLE `sights` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `image` varchar(255) NOT NULL,
  `hot` tinyint(1) DEFAULT '0',
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;;

-- ----------------------------
-- Records of sights
-- ----------------------------
BEGIN;
INSERT INTO `sights` VALUES (1, '落日夕阳', 'https://xinzhuobu.com/wp-content/uploads/2022/08/20220808008.jpg', 1, '2023-04-11 06:09:21', '2023-04-11 06:09:21');
INSERT INTO `sights` VALUES (2, '山川', 'https://xinzhuobu.com/wp-content/uploads/2023/05/20230505001.jpg', 1, '2023-04-17 21:24:01', '2023-04-17 21:24:04');
INSERT INTO `sights` VALUES (3, '天空', 'https://s1.ax1x.com/2022/05/29/XQqy24.jpg', 1, '2023-04-17 21:25:05', '2023-04-17 21:25:07');
INSERT INTO `sights` VALUES (4, '夜景', 'https://xinzhuobu.com/wp-content/uploads/2023/04/20230416018.jpg', 1, '2023-04-17 21:26:06', '2023-04-17 21:26:09');
INSERT INTO `sights` VALUES (5, '人物', 'https://s4.ax1x.com/2022/02/09/H8wLxs.jpg', 1, '2023-04-17 21:29:52', '2023-04-17 21:29:54');
INSERT INTO `sights` VALUES (6, '花草', 'https://www.helloimg.com/images/2022/11/03/ZYvVK0.jpg', 1, '2023-04-17 21:33:35', '2023-04-17 21:33:39');
COMMIT;

-- ----------------------------
-- Table structure for spots
-- ----------------------------
DROP TABLE IF EXISTS `spots`;
CREATE TABLE `spots` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text,
  `image` varchar(255) DEFAULT NULL,
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL,
  `cityId` int DEFAULT NULL,
  `userId` int DEFAULT NULL,
  `sightId` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `cityId` (`cityId`) USING BTREE,
  KEY `userId` (`userId`) USING BTREE,
  CONSTRAINT `spots_ibfk_7` FOREIGN KEY (`cityId`) REFERENCES `cities` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `spots_ibfk_8` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;;

-- ----------------------------
-- Records of spots
-- ----------------------------
BEGIN;
INSERT INTO `spots` VALUES (36, '您好重庆', '<p>你好，重庆</p>', '/6e1a540632aaeca8d1c141ef60beb450.jpeg', '2023-05-07 14:31:04', '2023-05-07 14:31:04', 1, 4, NULL);
INSERT INTO `spots` VALUES (37, '夕阳无限好', '<p>夕阳真好</p>', '/c5c6a37679fb17865bc8517ffe01baf7.jpeg', '2023-05-07 14:45:25', '2023-05-07 14:45:25', NULL, 4, 1);
INSERT INTO `spots` VALUES (38, '夕阳真好', '<p>很好搭</p>', '/f0b4926fa994b59e90cac0225eaffdbe.jpeg', '2023-05-07 15:18:29', '2023-05-07 15:18:29', NULL, 4, 1);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL,
  `commentId` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `username` (`username`) USING BTREE,
  UNIQUE KEY `email` (`email`) USING BTREE,
  UNIQUE KEY `username_2` (`username`) USING BTREE,
  UNIQUE KEY `email_2` (`email`) USING BTREE,
  UNIQUE KEY `username_3` (`username`) USING BTREE,
  UNIQUE KEY `email_3` (`email`) USING BTREE,
  UNIQUE KEY `username_4` (`username`) USING BTREE,
  UNIQUE KEY `email_4` (`email`) USING BTREE,
  UNIQUE KEY `username_5` (`username`) USING BTREE,
  UNIQUE KEY `email_5` (`email`) USING BTREE,
  UNIQUE KEY `username_6` (`username`) USING BTREE,
  UNIQUE KEY `email_6` (`email`) USING BTREE,
  UNIQUE KEY `username_7` (`username`) USING BTREE,
  UNIQUE KEY `email_7` (`email`) USING BTREE,
  UNIQUE KEY `username_8` (`username`) USING BTREE,
  UNIQUE KEY `email_8` (`email`) USING BTREE,
  UNIQUE KEY `username_9` (`username`) USING BTREE,
  UNIQUE KEY `email_9` (`email`) USING BTREE,
  UNIQUE KEY `username_10` (`username`) USING BTREE,
  UNIQUE KEY `email_10` (`email`) USING BTREE,
  UNIQUE KEY `username_11` (`username`) USING BTREE,
  UNIQUE KEY `email_11` (`email`) USING BTREE,
  UNIQUE KEY `username_12` (`username`) USING BTREE,
  UNIQUE KEY `email_12` (`email`) USING BTREE,
  UNIQUE KEY `username_13` (`username`) USING BTREE,
  UNIQUE KEY `email_13` (`email`) USING BTREE,
  UNIQUE KEY `username_14` (`username`) USING BTREE,
  UNIQUE KEY `email_14` (`email`) USING BTREE,
  UNIQUE KEY `username_15` (`username`) USING BTREE,
  UNIQUE KEY `email_15` (`email`) USING BTREE,
  UNIQUE KEY `username_16` (`username`) USING BTREE,
  UNIQUE KEY `email_16` (`email`) USING BTREE,
  UNIQUE KEY `username_17` (`username`) USING BTREE,
  UNIQUE KEY `email_17` (`email`) USING BTREE,
  UNIQUE KEY `username_18` (`username`) USING BTREE,
  UNIQUE KEY `email_18` (`email`) USING BTREE,
  UNIQUE KEY `username_19` (`username`) USING BTREE,
  UNIQUE KEY `email_19` (`email`) USING BTREE,
  UNIQUE KEY `username_20` (`username`) USING BTREE,
  UNIQUE KEY `email_20` (`email`) USING BTREE,
  UNIQUE KEY `username_21` (`username`) USING BTREE,
  UNIQUE KEY `email_21` (`email`) USING BTREE,
  UNIQUE KEY `username_22` (`username`) USING BTREE,
  UNIQUE KEY `email_22` (`email`) USING BTREE,
  UNIQUE KEY `username_23` (`username`) USING BTREE,
  UNIQUE KEY `email_23` (`email`) USING BTREE,
  UNIQUE KEY `username_24` (`username`) USING BTREE,
  UNIQUE KEY `email_24` (`email`) USING BTREE,
  UNIQUE KEY `username_25` (`username`) USING BTREE,
  UNIQUE KEY `email_25` (`email`) USING BTREE,
  UNIQUE KEY `username_26` (`username`) USING BTREE,
  UNIQUE KEY `email_26` (`email`) USING BTREE,
  UNIQUE KEY `username_27` (`username`) USING BTREE,
  UNIQUE KEY `email_27` (`email`) USING BTREE,
  UNIQUE KEY `username_28` (`username`) USING BTREE,
  UNIQUE KEY `email_28` (`email`) USING BTREE,
  UNIQUE KEY `username_29` (`username`) USING BTREE,
  UNIQUE KEY `email_29` (`email`) USING BTREE,
  UNIQUE KEY `username_30` (`username`) USING BTREE,
  UNIQUE KEY `email_30` (`email`) USING BTREE,
  UNIQUE KEY `username_31` (`username`) USING BTREE,
  UNIQUE KEY `email_31` (`email`) USING BTREE,
  KEY `commentId` (`commentId`) USING BTREE,
  CONSTRAINT `user_ibfk_1` FOREIGN KEY (`commentId`) REFERENCES `comments` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'rlwb', 'rlwb@qq.com', '$2b$10$6Gi9/GOzk5bLNekmJNjfi.zdc4NnqZL.raBkfLzxkPVXt60QX8Jl6', '2023-04-06 01:35:14', '2023-04-06 01:35:14', NULL);
INSERT INTO `user` VALUES (2, 'rlwb1', 'rlwb1@qq.com', '$2b$10$cdHd5RjBtDET3wKuxItVoeTsm5lHqGkKsXqOMqu81Nccv4Hfaoqgu', '2023-04-06 01:36:19', '2023-04-06 01:36:19', NULL);
INSERT INTO `user` VALUES (3, 'rlwb2', 'rlwb2@qq.com', '$2b$10$jUhx7UgrkLEmVsWid2HkYeCVNZpO0CfMzh06pW5.qy0gcxbWM38ku', '2023-04-06 01:50:03', '2023-04-06 01:50:03', NULL);
INSERT INTO `user` VALUES (4, 'zhuhongtao', '1@qq.com', '$2b$10$cdHd5RjBtDET3wKuxItVoeTsm5lHqGkKsXqOMqu81Nccv4Hfaoqgu', '2023-04-06 02:15:56', '2023-04-06 02:15:56', NULL);
INSERT INTO `user` VALUES (5, 'admin', '12@qq.com', '$2b$10$aJcTaFof4NAsMT4Js5RuueZJfah9Zxl.dpsOHIgC1GtErznfnuf1O', '2023-04-06 02:23:17', '2023-04-06 02:23:17', NULL);
INSERT INTO `user` VALUES (6, 'admin1', '11@qq.com', '$2b$10$FqADUxPuRhaajBym2DwEBOQtt7crUCRCOHr5i8JH.bdVcAVfNU8mO', '2023-04-06 02:24:01', '2023-04-06 02:24:01', NULL);
INSERT INTO `user` VALUES (7, 'admin12', '123@qq.com', '$2b$10$ufy9/VgnsN4oZQFj9H7WVuc8z9MYlcjW1L8zhYi5.7fQRuErheDZy', '2023-04-06 09:51:10', '2023-04-06 09:51:10', NULL);
INSERT INTO `user` VALUES (8, '123', '1234@qq.com', '$2b$10$x4HViKCVeCVQjaiLY7B9lO3zun2X3PGou4CCw28K6G1AAR883QtdC', '2023-04-06 09:53:14', '2023-04-06 09:53:14', NULL);
INSERT INTO `user` VALUES (9, '12345', '12345@qq.com', '$2b$10$LCTaSiLQqmk4ybWeCRnu1.t6/f5DJNl8jSpcSu1FXj6ivcSQTm5iC', '2023-04-06 09:59:55', '2023-04-06 09:59:55', NULL);
INSERT INTO `user` VALUES (10, 'admin123', '12323@qq.com', '$2b$10$VTQrW4Jp.9ilZruHcD1n/OIOEVFX/MX4N43.ebSJS4QFgqRwr7YKO', '2023-04-06 10:01:11', '2023-04-06 10:01:11', NULL);
INSERT INTO `user` VALUES (11, '1', '1093894078@qq.com', '$2a$10$XGNG8yeGxnXtm6UoJfES/eBfD9eVtwDBFcD/GwTBID3o5nnn5mrkm', '2023-04-18 15:14:11', '2023-04-18 15:14:11', NULL);
INSERT INTO `user` VALUES (12, 'test', '222@qq.com', '$2a$10$xc8ksom/seccc2kDi2yRpOqxMa/1y9edGQLZxSMFVOCfo306NH1g.', '2023-04-18 15:22:22', '2023-04-18 15:22:22', NULL);
INSERT INTO `user` VALUES (14, '213123213', '3@qq.com', '$2a$10$klaGb4YaN.lVenL2AefcMuYqNoOOnIMNToNcIWnYdx3GArMpt4gC6', '2023-04-23 15:07:22', '2023-04-23 15:07:22', NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
